<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2017/6/9
  Time: 10:26
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%
  String path = request.getContextPath();
  String basePath = request.getScheme() + "://"
          + request.getServerName() + ":" + request.getServerPort()
          + path + "/";
%>
<html>
<head>
    <title>Show All User Page!</title>


    <style>
      html{
        position: relative;
font-family:"微软雅黑";
      }
      a{
        text-decoration: none;
        color:lightseagreen;
      }



      a.hover{
        color:#fff;
        font-size: 20px;
      }
      td{
        width:100px;
        text-align: center;
        height:50px;

      }
      .tr1{
          font-size: 22px;
          color: lightseagreen;
      }
      .div{
position: absolute;
        top: 100px;
        width:1200px;height:560px;

        margin-left: 50px;
        background-color:#fdf9e0;
      }
      body{
        background-image:url(../../resources/image/1.jpg);
      }

      table{
        margin-left: 50px;
        width:90%;
        margin-top: 20px;
      }

      .title{
        width: auto;
       position: absolute;
        left:500px ;


        color:#fff;
      }
      span{
        color:lightseagreen;
      }

      .add{
position: absolute;
          top: 293px;
          left: 750px;

          width: 50px;
           color: white;
        }
        .add a{
            color: white;
        }

    </style>
  <meta http-equiv="Content-Type" content="text/html charset=utf-8">
  <% response.setContentType("text/html;charset=UTF-8");%>
  <% request.setCharacterEncoding("utf-8");%>
</head>
<body>

<div class="title">
  <span><h1>学生信息管理系统</h1></span>
</div>

<div class="div">

    <table>
        <tr class="tr1">
            <td width="70px" >学生姓名</td>
            <td width="90px">密码</td>
            <td width="120px">学号</td>
            <td width="200px">简介</td>
            <td width="70px">编辑</td>
            <td width="70px">修改</td>

        </tr>
        <!--循环遍历所有得到的记录并输出-->
        <c:forEach items="${recordList}" var="record">
            <tr>
                <td width="70px" >${record.username}</td>
                <td width="90px" >${record.password}</td>
                <td width="120px">${record.userId}</td>
                <td width="200px">${record.description}</td>
                <td><a href="/user/delete/${record.userId}">删除</a></td>
                <td><a href="/user/users/${record.userId}">更新</a></td>

            </tr>
        </c:forEach>
        <tr>
            <td colspan="6">
                <!-- 分页功能 start -->
                <div align="center">
                    <font size="2">共 ${page.totalPageCount} 页</font> <font size="2">第
                    ${page.pageNow} 页</font> <a href="/user${pageContext.request.contextPath}/queryAll?pageNow=1">首页</a>
                    <c:choose>
                        <c:when test="${page.pageNow - 1 > 0}">
                            <a href="/user${pageContext.request.contextPath}/queryAll?pageNow=${page.pageNow - 1}">上一页</a>
                        </c:when>
                        <c:when test="${page.pageNow - 1 <= 0}">
                            <a href="/user${pageContext.request.contextPath}/queryAll?pageNow=1">上一页</a>
                        </c:when>
                    </c:choose>
                    <c:choose>
                        <c:when test="${page.totalPageCount==0}">
                            <a href="/user${pageContext.request.contextPath}/queryAll?pageNow=${page.pageNow}">下一页</a>
                        </c:when>
                        <c:when test="${page.pageNow + 1 < page.totalPageCount}">
                            <a href="/user${pageContext.request.contextPath}/queryAll?pageNow=${page.pageNow + 1}">下一页</a>
                        </c:when>
                        <c:when test="${page.pageNow + 1 >= page.totalPageCount}">
                            <a href="/user${pageContext.request.contextPath}/queryAll?pageNow=${page.totalPageCount}">下一页</a>
                        </c:when>
                    </c:choose>
                    <c:choose>
                        <c:when test="${page.totalPageCount==0}">
                            <a href="/user${pageContext.request.contextPath}/queryAll?pageNow=${page.pageNow}">尾页</a>
                        </c:when>
                        <c:otherwise>
                            <a href="/user${pageContext.request.contextPath}/queryAll?pageNow=${page.totalPageCount}">尾页</a>
                        </c:otherwise>
                    </c:choose>

                <!-- 分页功能 End -->
            </td>

        </tr>
    </table>
    <div  class="add"  style="width:100px;height:30px;background-color:lightseagreen;margin-left: 150px;margin-top: 50px;text-align: center;line-height: 30px"><a href="/user/add" >添加</a></div>

</div>

</div>

</body>
</html>
